import { RouteRecordRaw, RouterView } from 'vue-router'

const routes: RouteRecordRaw = {
  path: 'setting',
  component: RouterView,
  meta: {
    title: '权限管理'
  },
  children: [
    {
      path: 'permission/admin',
      name: 'permission-admin',
      component: () => import('@/views/setting/permission/admin/index.vue'),
      meta: { // 自定义路由元数据
        title: '管理员'
      }
    },
    {
      path: 'permission/role',
      name: 'permission-role',
      component: () => import('@/views/setting/permission/role/index.vue'),
      meta: {
        title: '角色'
      }
    },
    {
      path: 'permission/rule',
      name: 'permission-rule',
      component: () => import('@/views/setting/permission/rule/index.vue'),
      meta: {
        title: '规则'
      }
    }
  ]
}

// const routes: RouteRecordRaw = {
//   path: 'setting',
//   component: RouterView,
//   meta: {
//     title: '设置'
//   },
//   children: [
//     permissionRoutes
//   ]
// }

export default routes
